<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <!--首页头部信息引入-->
    <#include "header.html" />

<body class="page-header-fixed">

<!--登录超时弹出div-->
<div id="TimeOutLogin" class="modal hide fade" tabindex="-1" data-focus-on="input:first">
    <form method="post" action="">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
            <h4>登录超时</h4>
        </div>
        <div class="modal-body">
            <div class="control-group">
                <div class="controls" style="text-align:center">
                    <span class="help-inline">用户名:</span>
                    <input name="userName" type="text" class="m-wrap medium" placeholder="用户名"/><br>
                    <span class="help-inline">密&nbsp;&nbsp;&nbsp;码:</span>
                    <input name="password" type="text" class="m-wrap medium" placeholder="密码"/>
                </div>
            </div>
        </div>

        <div class="modal-footer">
            <button type="button" data-dismiss="modal" class="btn">关闭</button>
            <button type="submit" class="btn green">登录</button>
        </div>
    </form>
</div>

<!--顶部导航栏-->
<#include "menu.html" />

<!-- 内容 -->
<div class="page-container">
    <!-- 右侧菜单导航 -->
    ${SYS_MENUS}
    <!--  页面内容 -->
    <div class="page-content">
        <!-- BEGIN 页面容器-->
        <div class="container-fluid">
            <#include "bread_crumbs.html" />
            <!--页面内容-->
            <div id="dashboard">
                <#include "main.html" />
            </div>
        </div>
    </div>
</div>
<!-- 底部 -->
<#include "footer.html" />
<!-- 页面级别的脚本 -->
<script src="${ctx}/js/app.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {


        $.ajaxSetup({
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            cache: false,
            complete: function (XHR, TS) {
                var sessionstatus = XHR.getResponseHeader("sessionstatus");
                if ("timeout" == sessionstatus) {

                    $("#TimeOutLogin").modal('show');
                    return;
                }
            }
        });
    });

    jQuery(document).ready(function () {
        App.init(); // 初始化页面事件
    });

    function openAct(ths) {

        var url = $(ths).attr("_url");
        $.ajax({
            url: "${ctx}" + url,
            error: function (e) {
                alert('error:' + e);
            },
            success: function (data) {
                $(ths).parentsUntil("div").find("li").removeClass();

                var li = $(ths).parent().parent().parent();
                var a = li.children(":eq(0)").children("span[class='selected']");
                if (a.length == 0 && $(ths).parent().parent().hasClass("page-sidebar-menu") != true) {
                    li.children(":eq(0)").append('<span class="selected"></span>');

                }

                var livel1Text= $(ths).text();
                var livel2Text=li.children("a").children("span[class='title']").text();
                var title=livel1Text;

                var liText="<li><a href='#'>"+livel1Text+"</a></li>";
                if(livel2Text){
                    title=livel1Text;
                    liText="<li><a href='#'>"+livel2Text+"</a><i class='icon-angle-right'></i></li>"+liText
                };
                $(".page-title").html(title);

                $("#breadcrumb").children(":gt(0)").remove();
                $("#breadcrumb").children("li:eq(0)").after(liText);



                $(ths).parent().addClass("active");
                li.addClass("active open");

                $("#dashboard").html(data);
            }
        });
    }

</script>
</body>